﻿using Avalonia.Controls;
using Avalonia.Interactivity;
using iOSClub.App.Desktop.Pages;
using iOSClub.App.Desktop.ViewModels.ToolPages;
using iOSClub.App.Desktop.Views;

namespace iOSClub.App.Desktop.ToolPages;

public partial class ToolHomeView : UserControl
{
    public ToolHomeView()
    {
        InitializeComponent();
    }
    

    private void SelectionClick(object? sender, RoutedEventArgs e)
    {
        if(sender is not Control control)return;
        if(control.DataContext is not PageRecord pageRecord)return;
        var main = ViewOpera.GetView<ToolPage>(this);
        main?.Navigate(pageRecord.PageTag);
    }
}